<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./lodash.min.js"></script>
    <script>
      const o1 = { a: undefined, b: function () {}, list: [1, 2, 3] };
      const newObj = _.cloneDeep(o1);
      // 递归深度赋值
      // Object.entries(o1).forEach((el) => {
      //   if (Array.isArray(el[1])) {
      //     newObj[el[0]] = [];
      //     el[1].forEach((elx) => {
      //       newObj[el[0]].push(elx);
      //     });
      //   } else {
      //     newObj[el[0]] = el[1];
      //   }
      // });
      console.log(newObj);
    </script>
  </body>
</html>
